namespace NHCodeFirst.FluentMapper
{
    using System;
    using HbmModel;

    public class EntityMemberMapper<TEntity> : MemberMapper<TEntity, EntityMemberMapper<TEntity>>
    {
        private Class @class;
        internal EntityMemberMapper(Class container) : base(container)
        {
            child = this;
            @class = container;
        }
     
        public EntityMemberMapper<TEntity> MapClass(Action<ClassMapper<TEntity>> classMapper)
        {
            classMapper(new ClassMapper<TEntity>(@class));
            return this;
        }

        public EntityMemberMapper<TEntity> MapJoinedSubClass(Action<JoinedSubClassMapper<TEntity>> joinedSubClassMapper)
        {
            joinedSubClassMapper(new JoinedSubClassMapper<TEntity>(@class));
            return this;
        }
    }
}